@import '../../../../styles-var/devui-var.scss';

.#{$devui-prefix}-table {
  &__thead {
    tr {
      border: none;
      background-color: $devui-base-bg;

      th {
        display: table-cell;
        text-align: left;
        padding: 0;
        border: none;
        border-bottom: 1px solid $devui-line;
        background-color: inherit;

        &.is-left {
          text-align: left;
        }

        &.is-center {
          text-align: center;
        }

        &.is-right {
          text-align: right;
        }
      }

      .operable:hover {
        background-color: $devui-list-item-hover-bg;
      }

      .resizeable:hover {
        .resize-handle {
          border-right: 1px solid $devui-line;
        }
      }

      .resizeable {
        .resize-handle:hover {
          border-right: 2px solid $devui-form-control-line-active;
        }
      }

      .sort-active,
      .filter-active {
        background-color: $devui-list-item-hover-bg;
        border-radius: $devui-border-radius 0 0 $devui-border-radius;
      }
    }

    .header-container {
      position: relative;
      display: flex;
      align-items: center;
      padding-left: 20px;
      padding-right: 8px;

      .title {
        display: inline-block;
        max-width: calc(100% - 18px);
        font-size: $devui-font-size;
        color: $devui-text;
        font-weight: 700;
        line-height: 36px;
        vertical-align: middle;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      .resize-handle {
        display: inline-block;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        cursor: col-resize;
      }

      .resize-overlay {
        position: absolute;
        display: block;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        z-index: 1000;
      }
    }

    .#{$devui-prefix}-table__checkable-cell .header-container {
      padding-left: 0;
    }
  }
}

.#{$devui-prefix}-table {
  &--header-bg {
    thead.#{$devui-prefix}-table__thead {
      tr {
        background: var(--devui-list-item-hover-bg, #f2f5fc);
      }
    }
  }
}
